package com.daniu.ssmdemo.mapper;

import com.daniu.ssmdemo.pojo.Account;
import org.apache.ibatis.annotations.Param;

public interface AccountMapper {



    /**
     * 往某个账号转入金额
     * @param cardno
     * @param amount
     * @return
     */
    public int addAccountMoney(
            @Param("cardno") String cardno,
            @Param("amount") double amount
    );
    /**\
     * 往某个账号转出金额
     * @param cardno
     * @param amount
     * @return
     */
    public int subAccountMoney(
            @Param("cardno") String cardno,
            @Param("amount") double amount
    );

    /**
     * 判断银行账号是否存在
     * @param cardno 账号
     * @return
     */
    public int accountIfExist(@Param("cardno")String cardno);

    //根据账号获取账号余额
    public double getMoneyByCardNo(@Param("cardno")String cardno);

    /**
     * 根据账号获取账户对象
     */
    public Account getAccountByCardNo(@Param("cardno")String cardno);
}
